<?php

namespace App\Models\Base;

use Illuminate\Database\Eloquent\Model;

class LogEverydayData extends Model
{
    protected $fillable = [
        'new_player_num',
        'login_player_num',
        'amount',
        'pay_player_num',
        'pay_player_ratio',
        'top_hour',
        'top_online_num',
        'arpu',
        'arppu',
        'date_time',
    ];

    /**
     * [remains 留存统计].
     *
     * @Author   王文凡
     * @DateTime 2018-04-27
     *
     * @version  1.0
     *
     * @return [type] [description]
     */
    public function remains()
    {
        return $this->hasMany(DayRemainNumber::class, 'everyday_data_id', 'id');
    }

    public function channel()
    {
        return $this->belongsTo('App\Models\Base\Charge', 'channel_id', 'channel_no');
    }

    public function server()
    {
        return $this->belongsTo('App\Models\Base\ServerList', 'server_id', 'server_id');
    }

    public function Platform()
    {
        return $this->belongsTo('App\Models\Base\Charge', 'platform_id', 'channel_no');
    }
}
